<template>
	<view>
	  <view class="item-war" v-for="(item, index) in arrList" :key="index" @click="friendDetails(item.user.id)">
		  <view class="item-top">
			<image class='top-img' :src="item.user.avatar!= ''?urls+ item.user.avatar : '../../../static/image/bg_img.png'">
			<view class='item-tops' >{{item.user.nickname}}</view>	
		  </view>
	  </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				arrList : [],
				phone:'',
				urls:this.$common.baseUrl
			}
		},
		onShow(){
			this.$msgchat.initwork();
			this.initDat();
		},
		onLoad(){
			// uni.onSocketMessage(function (res) {
			//   console.log('收到服务器内容：' + res.data);
			// });
		},
		methods: {
			initDat(){
				this.$common.requests('/api/black/laheiIndex').then(res => {
					if(res.data.code == 1){
						// res.data.data.forEach((key,index) => {
						// 	if(key.user.avatar != '' && key.user.avatar != null){
						// 		key.user.avatar = that.$common.baseUrl + key.user.avatar;
						// 	}
						// });
						this.arrList = res.data.data;
						console.log(this.arrList)
					}
				})
			},
			friendDetails(ids){
				console.log(ids)
				uni.navigateTo({
					url:'../../detailsData/detailsData?friend_id='+ids
				})
			},
		}
	}
</script>

<style lang="scss">
	 page{
		 height: 100%;
		 background: $uni-color-bei;
	 }
		 .cu-btn{
			 margin-right: 3%;
			 background: #F4F6FF;
			 color: $uni-bt-color;
			 width: 132upx;
		 }
		.item-title {
				color: #898989;
				padding: 0.4rem 0 0.6rem 0.8rem;
		}
		.item-war:nth-child(1){
			border-top: 1px solid $uni-color-bei;
		}
        .item-war{
          width: 100%;
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 0.5rem 0 0.5rem 1rem;
          /*margin-top: 0.7rem;*/
          background: #fff;
          border-bottom: 1px solid #ebeced;
        }
        .item-top{
          width: 100%;
          display: flex;
          justify-content: flex-start;
          align-items: center;
        }
        .item-tops{
          color: #333;
          // font-weight: bold;
          font-size: 18px;
		  margin-left: 50upx;
        }
        .top-img{
          width: 2.7rem;
		  height: 2.7rem;
          border-radius: 50%;
        }
        .bot-text{
          color: #898989;
          font-size: 16px;
        }




</style>
